package com.itheima.test2;

import java.io.IOException;
import java.net.*;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();

        String s ="要发送的东西";
        byte[] bytes = s.getBytes();

        InetAddress address = InetAddress.getByName("127.0.0.1");
        int port = 10000;

        DatagramPacket packet = new DatagramPacket(bytes,bytes.length,address,port);

        ds.send(packet);
        ds.close();

    }
}
